
/*

Design Pattern Automation Toolkit.
Application to create applications with emphasis on Design patterns.
And support for round trip engineering.
Copyright (C) 2004 Vineeth Neelakant. nvineeth@gmail.com

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

*/
using System;
using BusinessLayer;
using InfoClasses;
using dpatoolkit.UILayer;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace dpatoolkit.UILayer
{
    /// <summary>
    /// Summary description for Form1.
    /// </summary>
    public class ClassNameForm : System.Windows.Forms.Form
    {
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.TextBox ClassNameTextBox;
        private System.Windows.Forms.Button okButton;
        private System.Windows.Forms.Button cancelButton;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;
        private System.Windows.Forms.CheckBox abstrCheckBox;
        private string cName;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.ComboBox visibilityComboBox;
        private System.Windows.Forms.Label label3;
        private bool abstr;
        private string visibility, summary;
        private System.Windows.Forms.TextBox summaryTextBox;

        public ClassNameForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.visibilityComboBox.SelectedIndex = 0;
        }

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.label1 = new System.Windows.Forms.Label();
            this.ClassNameTextBox = new System.Windows.Forms.TextBox();
            this.okButton = new System.Windows.Forms.Button();
            this.cancelButton = new System.Windows.Forms.Button();
            this.abstrCheckBox = new System.Windows.Forms.CheckBox();
            this.label2 = new System.Windows.Forms.Label();
            this.visibilityComboBox = new System.Windows.Forms.ComboBox();
            this.label3 = new System.Windows.Forms.Label();
            this.summaryTextBox = new System.Windows.Forms.TextBox();
            this.SuspendLayout();
            // 
            // label1
            // 
            this.label1.Location = new System.Drawing.Point(16, 16);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(128, 24);
            this.label1.TabIndex = 5;
            this.label1.Text = "Enter the Class Name";
            // 
            // ClassNameTextBox
            // 
            this.ClassNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.ClassNameTextBox.Location = new System.Drawing.Point(152, 16);
            this.ClassNameTextBox.Name = "ClassNameTextBox";
            this.ClassNameTextBox.Size = new System.Drawing.Size(272, 20);
            this.ClassNameTextBox.TabIndex = 0;
            this.ClassNameTextBox.Text = "NewClass";
            // 
            // okButton
            // 
            this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.okButton.Location = new System.Drawing.Point(304, 232);
            this.okButton.Name = "okButton";
            this.okButton.Size = new System.Drawing.Size(75, 23);
            this.okButton.TabIndex = 3;
            this.okButton.Text = "&OK";
            this.okButton.Click += new System.EventHandler(this.okButton_Click);
            // 
            // cancelButton
            // 
            this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.cancelButton.Location = new System.Drawing.Point(392, 232);
            this.cancelButton.Name = "cancelButton";
            this.cancelButton.Size = new System.Drawing.Size(80, 24);
            this.cancelButton.TabIndex = 4;
            this.cancelButton.Text = "&CANCEL";
            // 
            // abstrCheckBox
            // 
            this.abstrCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.abstrCheckBox.Location = new System.Drawing.Point(152, 48);
            this.abstrCheckBox.Name = "abstrCheckBox";
            this.abstrCheckBox.Size = new System.Drawing.Size(264, 24);
            this.abstrCheckBox.TabIndex = 1;
            this.abstrCheckBox.Text = "Abstract Class";
            // 
            // label2
            // 
            this.label2.Location = new System.Drawing.Point(24, 136);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(100, 23);
            this.label2.TabIndex = 7;
            this.label2.Text = "Visibility";
            this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            this.label2.Visible = false;
            // 
            // visibilityComboBox
            // 
            this.visibilityComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.visibilityComboBox.Items.AddRange(new object[] {
            "public",
            "protected",
            "private"});
            this.visibilityComboBox.Location = new System.Drawing.Point(8, 176);
            this.visibilityComboBox.Name = "visibilityComboBox";
            this.visibilityComboBox.Size = new System.Drawing.Size(152, 21);
            this.visibilityComboBox.TabIndex = 8;
            this.visibilityComboBox.Visible = false;
            // 
            // label3
            // 
            this.label3.Location = new System.Drawing.Point(24, 80);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(100, 23);
            this.label3.TabIndex = 6;
            this.label3.Text = "Summary";
            this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // summaryTextBox
            // 
            this.summaryTextBox.AcceptsReturn = true;
            this.summaryTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.summaryTextBox.Location = new System.Drawing.Point(152, 88);
            this.summaryTextBox.Multiline = true;
            this.summaryTextBox.Name = "summaryTextBox";
            this.summaryTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
            this.summaryTextBox.Size = new System.Drawing.Size(328, 120);
            this.summaryTextBox.TabIndex = 2;
            // 
            // ClassNameForm
            // 
            this.AcceptButton = this.okButton;
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.CancelButton = this.cancelButton;
            this.ClientSize = new System.Drawing.Size(504, 270);
            this.Controls.Add(this.summaryTextBox);
            this.Controls.Add(this.ClassNameTextBox);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.visibilityComboBox);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.abstrCheckBox);
            this.Controls.Add(this.cancelButton);
            this.Controls.Add(this.okButton);
            this.Controls.Add(this.label1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
            this.Name = "ClassNameForm";
            this.Text = "Class Name";
            this.ResumeLayout(false);
            this.PerformLayout();

        }
        #endregion

        private void okButton_Click(object sender, System.EventArgs e)
        {
            cName = ClassNameTextBox.Text;
            abstr = abstrCheckBox.Checked;
            this.summary = this.summaryTextBox.Text;
            this.visibility = this.visibilityComboBox.SelectedText;
        }

        public string ClassName
        {
            set { ClassNameTextBox.Text = value; }
            get { return cName; }
        }
        public bool Abstract
        {
            set { abstrCheckBox.Checked = value; }
            get { return abstr; }
        }
        public string Visibility
        {
            get { return this.visibility; }
        }
        public string Summary
        {
            get { return this.summary; }
        }
    }
}